import Mock from 'mockjs';

export function mock() {
    // 获取推荐的订单列表
    Mock.mock(/order\/recommend/, 'get', {
        status: 0,
        message: 'OK',
        data: [
            {
                id: 12,
                nickname: '昵称',
                user_id: 12,
                // 'prepay'|'good'|'package'
                type: 'prepay',
                title: '经典婚纱摄影套餐',
                price: 1800,
                original_price: 123,
                link_id: 123,
                cover: '',
                referrer_id: 123,
                referrer_level: 23,
                // 'init' | 'close' | 'paid' | 'refund'
                status: 'init',
                // 0 | 1
                is_prepay: 0,
                // 0 | 1
                is_finish: 0,
                created_at: '2019-01-01 15:12:23',
                detail: [], //同订单详情
                gift: [],
            },
        ],
    });

    // 获取订单详情
    Mock.mock(/order\/detail/, 'get', {
        status: 0,
        message: 'OK',
        data: {
            id: 123,
            type: 'package',
            titile: '腾讯',
            price: 1800,
            original_price: 123,
            detail: {
                spec: [
                    {
                        id:123,
                        attr:'相框',
                        attr_value:'青铜相框',
                        price:100,
                        number:3,
                        is_default:[0|1],
                        cover:'http:www.baidu.com/cover.jgp',
                    },
                ],
                default_price: 123,
                order_cover: 'http://www.baidu.com/order_cover.jpg',
                is_free: [0|1],
                is_comment: [0 | 1],
            },
            we_chat_pay: 1900,
            we_chat_pay_time: '2019-01-01 12:30:10',
            coupon_pay: 2000,
            refund_fee: 1200,
            cover: 'http://www.baidu.com/cover.jpg',
            // 'init' | 'close' | 'paid' | 'refund'
            status: 'init',
            // 0 | 1 | 2 是否需要物流[0不需要|1需要发货|2已发货]
            delivery: 0,
            // 0 | 1
            is_comment: 0,
            // 0 | 1
            is_prepay: 0,
            // 0 | 1
            final_payment: 0, // 是否结清尾款 ，没有尾款也为1
            // 0 | 1
            buyer_confirm: 0, // 买家确认收货
        },
    });

    // 确认收货
    Mock.mock(/order\/finish/, 'get', {
        status: 0,
        message: 'OK',
    });

    // 评论
    Mock.mock(/order\/comment/, 'post', {
        status: 0,
        message: 'OK',
    });

    // 关闭订单
    Mock.mock(/order\/cancel/, 'get', {
        status: 0,
        message: 'OK',
    });
}
